Skip to content

Conversation

@dblythy
Copy link
Member

@dblythy dblythy commented Oct 1, 2025

Pull Request

Issue

Closes: #9086

Added LiveQuery query operation to execute queries through existing WebSocket subscriptions, eliminating separate REST API calls for data syncing.

Client SDK Changes Required:

  • Add result event type to LiveQuery constants

  • Handle result messages in WebSocket handler

  • Add query() method to subscription class

  • Add tests

Summary by CodeRabbit

  • New Features

    • LiveQuery adds an on-demand "query" operation: subscribers can request read results with where filtering and per-subscription field selection; responses honor session-based access and return matched records.
  • Bug Fixes

    • Improved error handling and reporting for missing clients, missing subscriptions, and query execution failures.
  • Tests

    • Added tests validating query handling, result payloads, field filtering, where constraints, delivery, and related error scenarios.

@parse-github-assistant
Copy link

parse-github-assistant bot commented Oct 1, 2025

🚀 Thanks for opening this pull request!

@coderabbitai
Copy link

coderabbitai bot commented Oct 1, 2025

📝 Walkthrough

Walkthrough

Adds a LiveQuery "query" operation: request schema, server handler to execute find queries and return results, client API to push query results, and tests validating result delivery, field selection, where constraints, and error paths.

Changes

Cohort / File(s) Summary
Tests: ParseLiveQuery query suite
spec/ParseLiveQueryQuery.spec.js
New Jasmine spec exercising LiveQuery query requests: success path with multiple objects, keys-based field filtering, where constraints, missing clientId/subscription error reporting, and helper mocks for clients/subscriptions.
LiveQuery Client: push result API
src/LiveQuery/Client.js
Adds pushResult (bound to _pushQueryResult) that builds op: 'result' messages including clientId, installationId, and requestId; maps results through _toJSONWithFields using per-subscription keys and sends via pushResponse.
LiveQuery Server: query op handling
src/LiveQuery/ParseLiveQueryServer.ts
Adds routing for op: 'query' and an async _handleQuery method: validates client and subscription, chooses auth (`subscription.sessionToken
Request Schema: query op
src/LiveQuery/RequestSchema.js
Adds query operation schema and registers RequestSchema.query with op: 'query' and numeric requestId.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant SDK as LiveQuery Client SDK
  participant WS as WebSocket Server
  participant Srv as ParseLiveQueryServer
  participant Sub as Subscription Registry
  participant DB as Data Store

  rect rgba(230,240,255,0.35)
    note left of SDK: client sends a query tied to a subscriptionId
  end

  SDK->>WS: { op: "query", requestId, id: subscriptionId, where, keys }
  WS->>Srv: route "query" request
  Srv->>Sub: lookup subscription(subscriptionId)
  alt subscription found
    Srv->>Srv: resolve auth (subscription.sessionToken || client.sessionToken || master)
    Srv->>DB: find(className, where, keys)
    DB-->>Srv: results[]
    Srv->>WS: push { op: "result", requestId, clientId, installationId, results }
    WS-->>SDK: deliver "result"
  else subscription missing
    Srv->>WS: push error { op: "error", requestId, ... }
    WS-->>SDK: deliver error
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify authentication selection and fallback (subscription.sessionTokenclient.sessionToken → master key) in src/LiveQuery/ParseLiveQueryServer.ts.
  • Confirm _pushQueryResult in src/LiveQuery/Client.js applies per-subscription keys consistently with _toJSONWithFields.
  • Inspect new tests in spec/ParseLiveQueryQuery.spec.js for proper mock setup/teardown and correctness of error-case assertions.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feature: run query via livequery" accurately and specifically describes the main change in this pull request. It clearly conveys that a new query feature is being added to LiveQuery functionality, which aligns directly with the substantial changes across the request schema, server handler, and client result-pushing mechanism. The title is concise, free of noise, and specific enough for developers scanning history to quickly understand the primary contribution.
Linked Issues Check ✅ Passed The code changes successfully implement the primary server-side requirements from issue #9086. The implementation enables running queries through LiveQuery subscriptions, adds a new "query" request operation to the schema, implements the server-side handler (_handleQuery in ParseLiveQueryServer), and provides the mechanism for pushing results back to clients (pushResult in Client.js). The comprehensive test suite validates query handling with existing subscriptions, field filtering (keys), and where constraints. The implementation achieves the core objective of enabling initial data sync over WebSocket to eliminate separate REST API calls, and the test coverage confirms the functionality works correctly. Client SDK changes required for complete end-to-end functionality are acknowledged in the PR description as separate work items.
Out of Scope Changes Check ✅ Passed All code changes in this pull request are directly aligned with the feature objective of adding query support to LiveQuery. The new test file (spec/ParseLiveQueryQuery.spec.js) validates the query feature implementation; the Client.js modifications (pushResult method) enable result delivery through subscriptions; the ParseLiveQueryServer.ts addition (_handleQuery method) implements core query request handling; and the RequestSchema.js changes define the query operation schema. No unrelated refactoring, cleanup, or out-of-scope modifications are present in the changeset.
Description Check ✅ Passed The pull request description follows the required template structure with all critical sections populated: it includes the issue closure link (#9086), provides a brief but meaningful explanation of the approach (adding a query operation to execute queries through WebSocket subscriptions and eliminating REST API calls), and marks the "Add tests" task as complete. While the approach section is somewhat concise, it conveys the essential intent of the feature. The description also appropriately acknowledges that client SDK changes are required as separate work.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a7ad48 and 466d789.

📒 Files selected for processing (1)
  • spec/ParseLiveQueryQuery.spec.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • spec/ParseLiveQueryQuery.spec.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: PostgreSQL 15, PostGIS 3.3
  • GitHub Check: PostgreSQL 16, PostGIS 3.5
  • GitHub Check: Redis Cache
  • GitHub Check: PostgreSQL 18, PostGIS 3.6
  • GitHub Check: PostgreSQL 15, PostGIS 3.5
  • GitHub Check: PostgreSQL 17, PostGIS 3.5
  • GitHub Check: Node 20
  • GitHub Check: PostgreSQL 15, PostGIS 3.4
  • GitHub Check: Node 18
  • GitHub Check: MongoDB 8, ReplicaSet
  • GitHub Check: MongoDB 6, ReplicaSet
  • GitHub Check: MongoDB 7, ReplicaSet
  • GitHub Check: Docker Build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Oct 1, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 1, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 1, 2025
@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

❌ Patch coverage is 56.60377% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.43%. Comparing base (389de84) to head (466d789).
⚠️ Report is 28 commits behind head on alpha.

Files with missing lines Patch % Lines
src/LiveQuery/ParseLiveQueryServer.ts 63.63% 15 Missing and 1 partial ⚠️
src/LiveQuery/Client.js 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #9864      +/-   ##
==========================================
- Coverage   93.02%   92.43%   -0.59%     
==========================================
  Files         187      187              
  Lines       15096    15216     +120     
  Branches      174      186      +12     
==========================================
+ Hits        14043    14065      +22     
- Misses       1041     1134      +93     
- Partials       12       17       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
spec/ParseLiveQueryQuery.spec.js (1)

6-19: Remove unnecessary done callback from synchronous beforeEach.

The beforeEach function is synchronous but declares a done parameter and calls it. Jasmine only requires the done callback for asynchronous setup. This adds unnecessary overhead.

Apply this diff:

-  beforeEach(function (done) {
+  beforeEach(function () {
     Parse.CoreManager.getLiveQueryController().setDefaultLiveQueryClient(null);
     // Mock ParseWebSocketServer
     const mockParseWebSocketServer = jasmine.createSpy('ParseWebSocketServer');
     jasmine.mockLibrary(
       '../lib/LiveQuery/ParseWebSocketServer',
       'ParseWebSocketServer',
       mockParseWebSocketServer
     );
     // Mock Client pushError
     const Client = require('../lib/LiveQuery/Client').Client;
     Client.pushError = jasmine.createSpy('pushError');
-    done();
   });
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f31285 and e3a169c.

📒 Files selected for processing (1)
  • spec/ParseLiveQueryQuery.spec.js (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-04-30T19:31:35.344Z
Learnt from: RahulLanjewar93
PR: parse-community/parse-server#9744
File: spec/ParseLiveQuery.spec.js:0-0
Timestamp: 2025-04-30T19:31:35.344Z
Learning: In the Parse Server codebase, the functions in QueryTools.js are typically tested through end-to-end behavior tests rather than direct unit tests, even though the functions are exported from the module.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
🧬 Code graph analysis (1)
spec/ParseLiveQueryQuery.spec.js (2)
src/LiveQuery/RequestSchema.js (1)
  • query (152-163)
spec/helper.js (1)
  • reconfigureServer (171-205)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: PostgreSQL 17, PostGIS 3.5
  • GitHub Check: PostgreSQL 15, PostGIS 3.4
  • GitHub Check: PostgreSQL 16, PostGIS 3.5
  • GitHub Check: MongoDB 8, ReplicaSet
  • GitHub Check: PostgreSQL 15, PostGIS 3.5
  • GitHub Check: Redis Cache
  • GitHub Check: Node 20
  • GitHub Check: Node 18
  • GitHub Check: MongoDB 7, ReplicaSet
  • GitHub Check: PostgreSQL 15, PostGIS 3.3
  • GitHub Check: MongoDB 6, ReplicaSet
  • GitHub Check: Docker Build
🔇 Additional comments (7)
spec/ParseLiveQueryQuery.spec.js (7)

21-27: LGTM! Proper async cleanup.

The cleanup properly closes LiveQuery clients and restores mocked libraries, ensuring test isolation.


29-35: LGTM! Well-structured test helper.

The helper cleanly creates and registers a mock client with a spy for result verification.


37-64: LGTM! Comprehensive subscription setup helper.

The helper correctly establishes subscription state on both server and client sides, mirroring the production subscription structure.


124-150: LGTM! Comprehensive error handling coverage.

These tests properly validate error paths when clientId is missing or subscription doesn't exist, ensuring robust error handling.


163-167: Verify serverURL configuration in field filtering and where constraint tests.

Similar to the first test, these tests use serverURL: 'http://localhost:1337/parse' while reconfigureServer likely uses a different port. Ensure this doesn't cause query execution failures.

The verification script from the earlier comment applies here as well.

Also applies to: 224-228


152-211: LGTM! Field filtering validation is thorough.

The test correctly validates that the keys parameter restricts returned fields, checking both included and excluded fields.


213-270: LGTM! Where clause filtering is properly tested.

The test validates that query constraints are correctly applied, returning only matching objects.

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 1, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
spec/ParseLiveQueryQuery.spec.js (1)

76-81: Previous serverURL concern is resolved.

Line 80 now correctly uses Parse.serverURL instead of a hard-coded URL, ensuring the LiveQueryServer and test Parse Server use the same endpoint.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3a169c and 4266ab6.

📒 Files selected for processing (1)
  • spec/ParseLiveQueryQuery.spec.js (1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: src/triggers.js:467-477
Timestamp: 2025-08-27T12:33:06.237Z
Learning: In the Parse Server codebase, maybeRunAfterFindTrigger is called in production with Parse.Query objects constructed via withJSON(), so the plain object query handling bug only affects tests, not production code paths.
📚 Learning: 2025-04-30T19:31:35.344Z
Learnt from: RahulLanjewar93
Repo: parse-community/parse-server PR: 9744
File: spec/ParseLiveQuery.spec.js:0-0
Timestamp: 2025-04-30T19:31:35.344Z
Learning: In the Parse Server codebase, the functions in QueryTools.js are typically tested through end-to-end behavior tests rather than direct unit tests, even though the functions are exported from the module.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-05-09T09:59:06.289Z
Learnt from: mtrezza
Repo: parse-community/parse-server PR: 9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: Tests in the parse-server repository should use promise-based approaches rather than callback patterns with `done()`. Use a pattern where a Promise is created that resolves when the event occurs, then await that promise.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-08-26T14:06:31.853Z
Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: spec/CloudCode.spec.js:446-469
Timestamp: 2025-08-26T14:06:31.853Z
Learning: In the Parse Server codebase, when handling query objects in maybeRunAfterFindTrigger, objects without a where property that contain options like limit/skip should be treated as query JSON with an empty where clause using the spread pattern { where: {}, ...query }, not nested as { where: query }.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-05-04T20:41:05.147Z
Learnt from: mtrezza
Repo: parse-community/parse-server PR: 9445
File: spec/ParseLiveQuery.spec.js:1312-1338
Timestamp: 2025-05-04T20:41:05.147Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-05-09T09:59:06.289Z
Learnt from: mtrezza
Repo: parse-community/parse-server PR: 9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`. The preferred pattern is to create a Promise that resolves when an expected event occurs, then await that Promise.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-08-27T12:33:06.237Z
Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: src/triggers.js:467-477
Timestamp: 2025-08-27T12:33:06.237Z
Learning: In the Parse Server codebase, maybeRunAfterFindTrigger is called in production with Parse.Query objects constructed via withJSON(), so the plain object query handling bug only affects tests, not production code paths.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-08-27T09:08:34.252Z
Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: src/triggers.js:446-454
Timestamp: 2025-08-27T09:08:34.252Z
Learning: When analyzing function signature changes in Parse Server codebase, verify that call sites are actually incorrect before flagging them. Passing tests are a strong indicator that function calls are already properly aligned with new signatures.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-10-16T19:27:05.311Z
Learnt from: Moumouls
Repo: parse-community/parse-server PR: 9883
File: spec/CloudCodeLogger.spec.js:410-412
Timestamp: 2025-10-16T19:27:05.311Z
Learning: In spec/CloudCodeLogger.spec.js, the test "should log cloud function triggers using the silent log level" (around lines 383-420) is known to be flaky and requires the extra `await new Promise(resolve => setTimeout(resolve, 100))` timeout after awaiting `afterSavePromise` for reliability, even though it may appear redundant.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
🧬 Code graph analysis (1)
spec/ParseLiveQueryQuery.spec.js (2)
src/LiveQuery/RequestSchema.js (1)
  • query (152-163)
spec/helper.js (1)
  • reconfigureServer (171-205)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: PostgreSQL 16, PostGIS 3.5
  • GitHub Check: PostgreSQL 15, PostGIS 3.3
  • GitHub Check: MongoDB 8, ReplicaSet
  • GitHub Check: PostgreSQL 15, PostGIS 3.5
  • GitHub Check: PostgreSQL 18, PostGIS 3.6
  • GitHub Check: PostgreSQL 15, PostGIS 3.4
  • GitHub Check: Node 18
  • GitHub Check: PostgreSQL 17, PostGIS 3.5
  • GitHub Check: MongoDB 6, ReplicaSet
  • GitHub Check: Redis Cache
  • GitHub Check: Node 20
  • GitHub Check: MongoDB 7, ReplicaSet
  • GitHub Check: Docker Build
🔇 Additional comments (4)
spec/ParseLiveQueryQuery.spec.js (4)

21-27: LGTM!

The afterEach hook properly uses async/await and performs necessary cleanup.


29-64: LGTM!

The helper functions are well-structured and provide clean setup for mock clients and subscriptions.


124-150: LGTM!

The error path tests properly validate that Client.pushError is called when clientId is missing or subscription doesn't exist. Using empty config is acceptable for these early-failure error tests.


152-270: LGTM!

These tests provide excellent coverage of the query operation's field filtering (keys) and where constraint features. The assertions properly validate that only selected fields are returned and only matching objects are included.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
spec/ParseLiveQueryQuery.spec.js (1)

65-270: Strong test coverage for the core query operation.

The test suite thoroughly validates:

  • Basic query execution with result verification
  • Error handling for missing client/subscription contexts
  • Field filtering via keys parameter
  • Where clause constraint application

All tests properly use async/await and the serverURL fix from the previous review is correctly applied.

Optional: Consider expanding test coverage.

To further harden the feature, you might add tests for:

  • ACL enforcement (users without read permissions)
  • Session token scenarios (non-master key queries)
  • Query options: limit, skip, order
  • Error responses for invalid/malformed queries
  • Edge case: empty result sets

These are not blockers for this PR but could improve long-term reliability.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4266ab6 and 2a7ad48.

📒 Files selected for processing (1)
  • spec/ParseLiveQueryQuery.spec.js (1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: src/triggers.js:467-477
Timestamp: 2025-08-27T12:33:06.237Z
Learning: In the Parse Server codebase, maybeRunAfterFindTrigger is called in production with Parse.Query objects constructed via withJSON(), so the plain object query handling bug only affects tests, not production code paths.
Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: spec/CloudCode.spec.js:446-469
Timestamp: 2025-08-26T14:06:31.853Z
Learning: In the Parse Server codebase, when handling query objects in maybeRunAfterFindTrigger, objects without a where property that contain options like limit/skip should be treated as query JSON with an empty where clause using the spread pattern { where: {}, ...query }, not nested as { where: query }.
📚 Learning: 2025-04-30T19:31:35.344Z
Learnt from: RahulLanjewar93
Repo: parse-community/parse-server PR: 9744
File: spec/ParseLiveQuery.spec.js:0-0
Timestamp: 2025-04-30T19:31:35.344Z
Learning: In the Parse Server codebase, the functions in QueryTools.js are typically tested through end-to-end behavior tests rather than direct unit tests, even though the functions are exported from the module.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-05-09T09:59:06.289Z
Learnt from: mtrezza
Repo: parse-community/parse-server PR: 9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: Tests in the parse-server repository should use promise-based approaches rather than callback patterns with `done()`. Use a pattern where a Promise is created that resolves when the event occurs, then await that promise.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-05-09T09:59:06.289Z
Learnt from: mtrezza
Repo: parse-community/parse-server PR: 9445
File: spec/ParseLiveQuery.spec.js:1340-1375
Timestamp: 2025-05-09T09:59:06.289Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`. The preferred pattern is to create a Promise that resolves when an expected event occurs, then await that Promise.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-05-04T20:41:05.147Z
Learnt from: mtrezza
Repo: parse-community/parse-server PR: 9445
File: spec/ParseLiveQuery.spec.js:1312-1338
Timestamp: 2025-05-04T20:41:05.147Z
Learning: New tests in the parse-server repository should use async/await with promise-based patterns rather than callback patterns with `done()`.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-08-26T14:06:31.853Z
Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: spec/CloudCode.spec.js:446-469
Timestamp: 2025-08-26T14:06:31.853Z
Learning: In the Parse Server codebase, when handling query objects in maybeRunAfterFindTrigger, objects without a where property that contain options like limit/skip should be treated as query JSON with an empty where clause using the spread pattern { where: {}, ...query }, not nested as { where: query }.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-08-27T12:33:06.237Z
Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: src/triggers.js:467-477
Timestamp: 2025-08-27T12:33:06.237Z
Learning: In the Parse Server codebase, maybeRunAfterFindTrigger is called in production with Parse.Query objects constructed via withJSON(), so the plain object query handling bug only affects tests, not production code paths.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-08-27T09:08:34.252Z
Learnt from: EmpiDev
Repo: parse-community/parse-server PR: 9770
File: src/triggers.js:446-454
Timestamp: 2025-08-27T09:08:34.252Z
Learning: When analyzing function signature changes in Parse Server codebase, verify that call sites are actually incorrect before flagging them. Passing tests are a strong indicator that function calls are already properly aligned with new signatures.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
📚 Learning: 2025-10-16T19:27:05.311Z
Learnt from: Moumouls
Repo: parse-community/parse-server PR: 9883
File: spec/CloudCodeLogger.spec.js:410-412
Timestamp: 2025-10-16T19:27:05.311Z
Learning: In spec/CloudCodeLogger.spec.js, the test "should log cloud function triggers using the silent log level" (around lines 383-420) is known to be flaky and requires the extra `await new Promise(resolve => setTimeout(resolve, 100))` timeout after awaiting `afterSavePromise` for reliability, even though it may appear redundant.

Applied to files:

  • spec/ParseLiveQueryQuery.spec.js
🧬 Code graph analysis (1)
spec/ParseLiveQueryQuery.spec.js (2)
src/LiveQuery/RequestSchema.js (1)
  • query (152-163)
spec/helper.js (1)
  • reconfigureServer (171-205)
🔇 Additional comments (2)
spec/ParseLiveQueryQuery.spec.js (2)

6-26: LGTM! Previous issues resolved.

The beforeEach and afterEach hooks are now correctly implemented using modern async/await patterns. The hard-coded serverURL issue from the previous review has also been addressed in the test setup below.


28-63: LGTM! Helper functions follow established patterns.

The mock client and subscription helpers correctly set up the test infrastructure, mirroring the patterns used in ParseLiveQueryServer.spec.js. The pushResult spy enables verification of query results, and the subscriptionInfo structure properly captures field filtering via keys.

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to run queries through LiveQueryClient

2 participants